<?php
/**
 * Asset Form
 *
 * @category   Cms
 * @package    Cms_Form
 */
class Cms_Form_Catalog_Asset_Form extends BIS_Form_Abstract
{
    public function init()
    {
        $this->addElementPrefixPath('Cms_Decorator',
                            	     APPLICATION_PATH . '/modules/cms/models/decorator/',
                            	    'decorator');
        
        $this->setMethod('post');
        $this->setAction('');

        $this->addElement('text', 'name', array(
            'label' => 'Asset Name',
            'size' => 30,
            'filters' => array('StringTrim'),
            'required' => true
        ));
        
        $this->addElement('textarea', 'description', array(
            'label' => 'Description',
            'rows' => 5,
            'cols' => 50,
            'filters' => array('StringTrim')
        ));

        $this->addElement('text', 'cost', array(
        		'label' => 'Cost',
        		'size' => 20,
        		'validators' => array('Float'),
        		'required' => true
        ));
        
        $this->addElement('text', 'purchasedDate',array(
        		'label' => 'Purchased Date',
        		'size' => 20,
        		'required' => true,
        		'validators' => array(array('Date', true, array('dd/MM/yyyy'))),
        		'filters' => array('StringTrim')
        ));
        
        $this->setElementDecorators(array(
            'ViewHelper',
            'FormElementsErrors',
             array(array('data' => 'HtmlTag'),  array('tag' =>'td')),
              'FormElementsLabel',
            array(array('row' => 'HtmlTag'), array('tag' => 'tr'))
        ));

        $this->setDecorators(array(
            'FormElements',
            array('HtmlTag', array('tag' => 'table', 'class'=> 'form')),
            'Form'
        ));

    }
}